package com.bdqn.zhang.controller;

import com.bdqn.zhang.pojo.User;
import com.bdqn.zhang.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

@Controller
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @RequestMapping(value = "/login")
    public String login(Model model){
        return "login/login";
    }

    @RequestMapping(value = "/dologin")
    public String dologin(User user, Model model){
        userService.dologin(user);
        return "redirect:user/user";
    }

    /*@RequestMapping(value = "/count")
    public String count(Model model){
        System.out.println(userService.count().toString());
        model.addAttribute("count","666");
        return "test/test";
    }*/
}
